using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: daiduong19051986@gmail.com 
	/// <summary>
	
    public class csreportgroupdetailInfo
    {
		#region Local Variable
		public enum Field
		{
			DB,
			reportgroup,
			reportcode
		}
		private String _DB;
		private String _reportgroup;
		private String _reportcode;
		
		public String DB{	get{ return _DB;} set{_DB = value;} }
		public String reportgroup{	get{ return _reportgroup;} set{_reportgroup = value;} }
		public String reportcode{	get{ return _reportcode;} set{_reportcode = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public csreportgroupdetailInfo()
		{
			_DB = "";
			_reportgroup = "";
			_reportcode = "";
		}
		public csreportgroupdetailInfo(
		String DB,
		String reportgroup,
		String reportcode
		)
		{
			_DB = DB;
			_reportgroup = reportgroup;
			_reportcode = reportcode;
		}
		public csreportgroupdetailInfo(DataRow dr)
		{
			if (dr != null)
			{
				_DB = dr[Field.DB.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DB.ToString()]);
				_reportgroup = dr[Field.reportgroup.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.reportgroup.ToString()]);
				_reportcode = dr[Field.reportcode.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.reportcode.ToString()]);
			}
		}
		public csreportgroupdetailInfo(DataRowView dr)
		{
			if (dr != null)
			{
				_DB = dr[Field.DB.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.DB.ToString()]);
				_reportgroup = dr[Field.reportgroup.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.reportgroup.ToString()]);
				_reportcode = dr[Field.reportcode.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.reportcode.ToString()]);
			}
		}
		public csreportgroupdetailInfo(csreportgroupdetailInfo objEntr)
		{			
			_DB = objEntr.DB;			
			_reportgroup = objEntr.reportgroup;			
			_reportcode = objEntr.reportcode;			
		}
        #endregion Constructor
        
        #region InitTable
		public DataTable ToDataTable()
		{
			DataTable dt = new DataTable("csreportgroupdetail");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.DB.ToString(), typeof(String)),
				new DataColumn(Field.reportgroup.ToString(), typeof(String)),
				new DataColumn(Field.reportcode.ToString(), typeof(String))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.DB.ToString()] = _DB;
			row[Field.reportgroup.ToString()] = _reportgroup;
			row[Field.reportcode.ToString()] = _reportcode;
			return row;
		}
        #endregion InitTable
    }
}
